package com.cy.shiro.dao;

import com.cy.shiro.pojo.SysResources;
import com.cy.shiro.pojo.SysUser;
import com.cy.shiro.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
@Mapper
public interface SysResourcesDao {

//    @Select("select * from sys_resources where id = #{id}")
    public SysResources findById(Integer id);

    //用户权限列表
    public List<SysResources> resourcesList(Integer userId);

    //获取所有权限
    public  List<SysResources> listAll();

    //获取用户权限
    public List<SysResources> listByUserId(Integer userId);

    //获取菜单
    public List<SysResources> listMenu();

    //获取菜单按钮
    public List<SysResources> listButton(Integer parentId);

    //所有资源列表
    public List<SysResources> selectAllResoures(Map<String, String> map);

    //获取可用菜单
    public  List<SysResources> listAllAvailableMenu();

    //添加用户
    public Integer addResources(SysResources sysResources);

    //保存
    public Integer editResources(SysResources sysResources);

    //删除
    public Integer delResources(Integer id);

    //获取权限资源列表
    public List<SysResources> queryResourcesListWithSelected(Integer id);

}
